Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Action Plan matrix item type render bugs (M2-8348) #560

Merged

Conversation

farmerpaul
Copy link
Contributor

@farmerpaul farmerpaul commented Dec 9, 2024

  • Tests for the changes have been added

📝 Description

🔗 Jira Ticket M2-8348

Simplified and fixed logic for generating response text for matrix item types (Single Selection per Row, Multiple Selection per Row). Aligned behaviour with Figma (see 4 examples shown in this row). Specifically:

  • Simply omit data from rows/columns where no selection was made, rather than display "skipped" text
  • The order of responses shouldn't change based on the format picked from the dropdown – responses should always be output by column left to right, then by row top to bottom. The only thing that changes based on the format selection is whether to output each response as columnLabel rowLabel vs. rowLabel columnLabel (and whether to display as bullets or sentences – although that aspect wasn't touched in this PR).

📸 Screenshots

CleanShot.2024-12-09.at.15.50.00.mp4

🪤 Peer Testing

Setup:

  • Applet with an activity containing a Single Selection per Row item, a Multiple Selection per Row Item, and a Phrase Builder referencing those items
  • Ensure each matrix item contain multiple rows and columns, and that they are skippable

Steps:

  1. Open the web app and start the activity.
  2. For each matrix item type, answer at least one row but leave some rows unanswered.
  3. Proceed to the Action Plan.
    Expected outcome: Rows for which there are no answers do not display "(Question skipped)"
  4. Go back and adjust your responses so that multiple items are selected in a row (for the Multiple Selection per Row item) and multiple rows have the same column selected (for the Single Selection per Row item).
  5. Proceed to the Action Plan.
    Expected outcome: Responses are rendered in the order of walking through the grid from left to right and top to bottom, as if reading a paragraph of text (per Figma spec).
  6. Go back and clear all your responses for both matrix items.
  7. Proceed to the Action Plan.
    Expected outcome: Each response is rendered as "(Question skipped)" in the Action Plan.
  8. In the Admin App, edit the Phrase Builder item and change the formats for the matrix items to render each response in a different format than before.
  9. Log out of the Web App and log back in, and perform the activity again.
  10. Choose a variety of answers for each matrix item.
  11. Proceed to the Action Plan.
    Expected outcome: Responses are still rendered in the order of walking through the grid from left to right and top to bottom, as if reading a paragraph of text (per Figma spec), with the only change being whether the answers are rendered as a sentence vs. a bullet list, or the order in which each response has its row/column label displayed.

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-560.d15zn9do8xbzga.amplifyapp.com

@farmerpaul farmerpaul marked this pull request as ready for review December 9, 2024 20:09
Copy link
Contributor

@sultanofcardio sultanofcardio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good so I'll approve. I noticed one other bug that I think we could address here

Simplified and fixed logic for generating response text for matrix item
types (single selection per row, multiple selection per row). Omitted
row selections should not display any "skipped" text. Also, the order
of responses shouldn't change based on the format picked from the
dropdown – responses should always be output by column left to right,
then by row top to bottom. The only thing that changes based on the
format selection is whether to output the response as
"columnLabel rowLabel" vs. "rowLabel columnLabel".
- Do not treat slider 0 value as "skipped" for `sliderRows`
- Output individual `slider` response in same format as `sliderRows`
@farmerpaul farmerpaul force-pushed the fix/M2-8348-action-plan-single-select-and-multi-select-bug branch from 1778f02 to 568a400 Compare December 11, 2024 16:59
@farmerpaul farmerpaul merged commit 5a99170 into dev Dec 12, 2024
3 checks passed
@farmerpaul farmerpaul deleted the fix/M2-8348-action-plan-single-select-and-multi-select-bug branch December 12, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants